package goodsModel

import (
	"gitee.com/libwiki/lib-mall/models"
	"gitee.com/libwiki/lib-mall/package/vars"
)

// GoodsProduct 商品
type GoodsProduct struct {
	Code           string        `json:"code" gorm:"type:varchar(64);comment:商品货源唯一code"`
	Name           string        `json:"name" gorm:"comment:货源标题"`
	Desc           string        `json:"desc" gorm:"comment:货源描述"`
	AdvertImages   []byte        `json:"advert_images" gorm:"comment:广告轮播图"`
	InfoImages     []byte        `json:"info_images" gorm:"comment:详情长图"`
	ExtendAttrs    []byte        `json:"extend_attrs" gorm:"comment:扩展属性"`
	LockPrice      bool          `json:"lock_price" gorm:"comment:是否锁定零售价（锁定后，代理尽可按建议零售价出售）"`
	LockBonus      bool          `json:"lock_bonus" gorm:"comment:锁定库存（锁定库存后购买不会减少库存）"`
	LockStock      bool          `json:"lock_stock" gorm:"comment:锁定佣金（锁定后代理不可更改指定的佣金）"`
	Returnable     bool          `json:"returnable" gorm:"comment:是否支持退货"`
	Status         bool          `json:"status" gorm:"comment:上架、下架状态"`
	Uid            uint          `json:"uid" gorm:"comment:所属用户"`
	SourceId       uint          `json:"source_id" gorm:"comment:所属用户"`
	StoreId        uint          `json:"store_id" gorm:"comment:所属门店"`
	Type           vars.Enum     `json:"type" gorm:"default:logistics;type:enum('logistics','virtual','service');comment:物流、虚拟、服务"`
	AgentStatus    vars.Enum     `json:"agent_status" gorm:"default:wait;type:enum('wait','success','fail');comment:代理审核状态"`
	AgentTime      vars.Datetime `json:"agent_time" gorm:"comment:代理时间"`

	models.BaseModel
	models.DeleteField
}
